import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/train_plan/get_offline_training_results_entity.dart';

GetOfflineTrainingResultsEntity $GetOfflineTrainingResultsEntityFromJson(Map<String, dynamic> json) {
  final GetOfflineTrainingResultsEntity getOfflineTrainingResultsEntity = GetOfflineTrainingResultsEntity();
  final int? assessmentResults = jsonConvert.convert<int>(json['assessmentResults']);
  if (assessmentResults != null) {
    getOfflineTrainingResultsEntity.assessmentResults = assessmentResults;
  }
  final int? classHour = jsonConvert.convert<int>(json['classHour']);
  if (classHour != null) {
    getOfflineTrainingResultsEntity.classHour = classHour;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    getOfflineTrainingResultsEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    getOfflineTrainingResultsEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    getOfflineTrainingResultsEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    getOfflineTrainingResultsEntity.deleted = deleted;
  }
  final String? departmentId = jsonConvert.convert<String>(json['departmentId']);
  if (departmentId != null) {
    getOfflineTrainingResultsEntity.departmentId = departmentId;
  }
  final String? departmentName = jsonConvert.convert<String>(json['departmentName']);
  if (departmentName != null) {
    getOfflineTrainingResultsEntity.departmentName = departmentName;
  }
  final String? lecturerName = jsonConvert.convert<String>(json['lecturerName']);
  if (lecturerName != null) {
    getOfflineTrainingResultsEntity.lecturerName = lecturerName;
  }
  final String? lecturerId = jsonConvert.convert<String>(json['lecturerId']);
  if (lecturerId != null) {
    getOfflineTrainingResultsEntity.lecturerId = lecturerId;
  }
  final int? fraction = jsonConvert.convert<int>(json['fraction']);
  if (fraction != null) {
    getOfflineTrainingResultsEntity.fraction = fraction;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    getOfflineTrainingResultsEntity.id = id;
  }
  final String? planId = jsonConvert.convert<String>(json['planId']);
  if (planId != null) {
    getOfflineTrainingResultsEntity.planId = planId;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    getOfflineTrainingResultsEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    getOfflineTrainingResultsEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    getOfflineTrainingResultsEntity.updateDate = updateDate;
  }
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    getOfflineTrainingResultsEntity.userId = userId;
  }
  final String? userName = jsonConvert.convert<String>(json['userName']);
  if (userName != null) {
    getOfflineTrainingResultsEntity.userName = userName;
  }
  return getOfflineTrainingResultsEntity;
}

Map<String, dynamic> $GetOfflineTrainingResultsEntityToJson(GetOfflineTrainingResultsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['assessmentResults'] = entity.assessmentResults;
  data['classHour'] = entity.classHour;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['departmentId'] = entity.departmentId;
  data['departmentName'] = entity.departmentName;
  data['lecturerName'] = entity.lecturerName;
  data['lecturerId'] = entity.lecturerId;
  data['fraction'] = entity.fraction;
  data['id'] = entity.id;
  data['planId'] = entity.planId;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['userId'] = entity.userId;
  data['userName'] = entity.userName;
  return data;
}

extension GetOfflineTrainingResultsEntityExtension on GetOfflineTrainingResultsEntity {
  GetOfflineTrainingResultsEntity copyWith({
    int? assessmentResults,
    int? classHour,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? departmentId,
    String? departmentName,
    String? lecturerName,
    String? lecturerId,
    int? fraction,
    String? id,
    String? planId,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? userId,
    String? userName,
  }) {
    return GetOfflineTrainingResultsEntity()
      ..assessmentResults = assessmentResults ?? this.assessmentResults
      ..classHour = classHour ?? this.classHour
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..departmentId = departmentId ?? this.departmentId
      ..departmentName = departmentName ?? this.departmentName
      ..lecturerName = lecturerName ?? this.lecturerName
      ..lecturerId = lecturerId ?? this.lecturerId
      ..fraction = fraction ?? this.fraction
      ..id = id ?? this.id
      ..planId = planId ?? this.planId
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..userId = userId ?? this.userId
      ..userName = userName ?? this.userName;
  }
}
